package com.weichen.studentgameexchange.member.controller;

import com.weichen.studentgameexchange.member.entity.User;
import com.weichen.studentgameexchange.member.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 功能：
 * 作者：惟尘
 * 日期：2025/2/4 11:08
 */
@RestController
@RequestMapping("/member")
public class FeignController {

    @Autowired
    IUserService userService;

    @GetMapping("/{userId}")
    public User getUserById(@PathVariable Long userId) {
        return userService.getById(userId);
    }

    @PostMapping("/add/batch")
    public List<User> getUserByIds(@RequestBody List<Long> userIds) {
        return userService.getUserByIds(userIds);
    }

    @GetMapping("/getUserId")
    public User getUserId(@RequestParam("username") String username){
        return userService.getUserId(username);
    }
}